package com.hjb.toolbardemo.utils;

import com.hjb.toolbardemo.inter.Api;
import com.okhttpfinal.HttpRequest;
import com.okhttpfinal.MyBaseHttpRequestCallback;
import com.okhttpfinal.RequestParams;

/**
 * 作者 : hjb
 * 时间 : 2016/4/27.
 */
public class OkHttpUtils {
    private static void post(String url, RequestParams params, MyBaseHttpRequestCallback callback) {
        HttpRequest.post(url, params, callback);
    }

    /**
     * 列出活动
     *
     * @param pagerNumber
     * @param pageSize
     * @param callback
     */
    public static void listActivity(int pagerNumber, int pageSize, MyBaseHttpRequestCallback callback) {
        RequestParams params = new RequestParams();
        params.addFormDataPart("pagerNumber", pagerNumber);
        params.addFormDataPart("pageSize", pageSize);
        post(Api.LIST_ACTIVITY, params, callback);
    }
}
